var yinCang = document.getElementById('gengduoneirong');
var gengDuo = document.getElementById('gengduozhankai');
gengDuo.onclick = function(){
	zhanKai();
}
function zhanKai(){
	if(yinCang.style.display == 'none'){
		yinCang.style.display = 'block';
	}else{
		yinCang.style.display = 'none';
	}
}
gengDuo.onclick = function(){
	zhanKai();
}

var showDiv = document.getElementById('tuijian');
var youDiv = document.getElementById('yuanright');
var zuoDiv = document.getElementById('yuanleft');

function you(sum){
	zuoDiv.style.opacity = '0.4';
	youDiv.style.opacity = '1';
	showDiv.style.transition="500ms ease-out";
	showDiv.style.transform="translate("+sum+"px,0)";
}
function zuo(sum){
	zuoDiv.style.opacity = '1';
	youDiv.style.opacity = '0.4';
	showDiv.style.transition = "500ms ease-out";
	showDiv.style.transform = "translate("+sum+"px,0)";
}

var	changeImgDiv = document.getElementById('chang');
var dianDiv = document.getElementById('youfan');
var page = 0;

function tiaoZhuan(){
	page++;
	if (page > 3) {
		page = 0;
	}
	change(page);

}
setInterval(tiaoZhuan,3000);

var	yuanDiv1 = document.getElementById('xiaodian1');
var	yuanDiv2 = document.getElementById('xiaodian2');
var	yuanDiv3 = document.getElementById('xiaodian3');
var	yuanDiv4 = document.getElementById('xiaodian4');

var yuanDivs = [yuanDiv1,yuanDiv2,yuanDiv3,yuanDiv4];

function change(index){
	for (var i = 0; i < yuanDivs.length; i++) {
		yuanDivs[i].style.backgroundColor = 'white';
	}
	yuanDivs[index].style.backgroundColor = "green";
	changeImgDiv.style.transition = "500ms ease-out";
	changeImgDiv.style.transform = "translate(" + (-590*index) + "px,0)";
}